package com.loft.threadtask;

import java.util.ArrayList;

import com.loft.R;
import com.loft.comm.MyApp;
import com.loft.comm.util.LogCenter;
import com.loft.controller.HTTPCenterController;
import com.loft.vo.renren.UserVo;

import android.R.integer;
import android.app.Dialog;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

/**
 * @author heb
 * @class_name getUserInfoAsynctask.java
 * @create_date 2012/05/14
 * @version 1.0.0
 */
public class DataAsynctask extends AsyncTask<String, Object, Object> {
	private Context _context;
	private int _thread_flag;
	private Handler _handler;
	private Message _message;
	private HTTPCenterController _connectionContext;
	private String _uid;

	public DataAsynctask(Context context, int thread_flag, Handler handler,
			String className, String uid) {
		Log.d("RESULT", className);
		this._context = context;
		this._thread_flag = thread_flag;
		this._handler = handler;
		this._message = new Message();
		this._message.what = thread_flag;
		this._uid = uid;
		this._connectionContext = new HTTPCenterController(className, uid);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.os.AsyncTask#doInBackground(Params[])
	 */
	@Override
	protected Object doInBackground(String... params) {
		return _connectionContext.doConnect();
	}

	@Override
	protected void onPostExecute(Object result) {
		_message.obj = result;
		_handler.sendMessage(_message);
		super.onPostExecute(result);
	}
}
